"""model_base URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path
from myApp import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('test/',views.test.as_view()),

    path('main/', views.blank),
    path('clsoperation/', views.clsOperation),
    path('login/', views.login.as_view()),
    path('student/<str:page>/', views.student.as_view()),
    path('teacher/<str:page1>/', views.teacher.as_view()),
    path('classes/<str:page>/', views.classes.as_view()),
    path('add/<str:which>/', views.add),


    # path('add/', views.add.as_view()),

    # re_path(r"articles/(\d{5})/$",views.articles),
]
# re_path传递参数的两种方法，传递过去的参数都是字符串的格式，不需要自己转换了
# 匿名参数：只需要加()，django就会把它其中的内容当作一个参数传递到函数中
# 命名参数：(?P<name>),django就会把它其中的内容当作一个关键字参数传递到函数中

# path传递参数时，必须指定参数的类型，不是字符串类型的需要在views.py中将参数转换为字符串格式的
# str：不包括"/"
# int:输入的是0或者正数，返回的int类型的
# path:和str一样，但是包括"/"
# path('articles/<int:year>', views.articles),
